package mlProject.classifier;

import java.util.ArrayList;
import mlProject.DocModel;

public class DataModelTransfer {
	public static ArrayList<DataModel> transfer(ArrayList<DocModel> docModels){
		
		ArrayList<DataModel> dataModels = new ArrayList<>();
		for(int i = 0 ; i < docModels.size() ; i++){
			DataModel dataModel = new DataModel();
			DocModel docModel = docModels.get(i);
			for(int j = 0 ; j < docModel.features.size() ; j ++){
				dataModel.attrs.put(docModel.features.get(j).name, docModel.features.get(j).value);
			}
			dataModel.label = docModel.label;
			dataModels.add(dataModel);
		}
		
		return dataModels;
	}
}
